package com.example.demo.service;

import com.example.demo.dao.CarDAO;
import com.example.demo.dao.GoodsDAO;
import com.example.demo.entity.Car;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CarService {
    @Autowired
    private CarDAO carDAO;

    public void updateNum(int goodsid,int num,int userid)
    {
        carDAO.updateNum(goodsid,num,userid);
    }

    public void insertCar(int goodsid,int num,int userid)
    {
        carDAO.insertCar(goodsid,num,userid);
    }

    public Car findbyid(int goodsid,int userid)
    {
        return carDAO.findbyid(goodsid,userid);
    }

    public void removeFromCar(int goodsid,int userid)
    {
        carDAO.removeFromCar(goodsid,userid);
    }

    public void clearCar(int userid)
    {
        carDAO.clearCar(userid);
    }

    public List<Car> findUserCar(int userid)
    {

        return carDAO.findUserCar(userid);
    }


}
